package model;

import java.text.ParseException;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class User {
    private String name;
    private String no;
    private String mobile;
    private Date time;

    public User() {
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNo() {
        return this.no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public Date getTime() {
        return this.time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public void setTime(String time) {
        if (null != time.trim() && "" != time.trim()) {
            String[] times = time.split("-");
            Calendar calendar = Calendar.getInstance();
            calendar.set(Integer.parseInt(times[0]), Integer.parseInt(times[1]), Integer.parseInt(times[2]));
            this.time = calendar.getTime();
        }
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
}
